# -*- encoding: utf-8 -*-
"""
File Name: heart_beat
Description:
Author : 'lirui'
date: 2024/4/12
Contact: marjey_lee@163.com
Change Activity:
2024/4/12:
"""
import time

from modules.blk.alarm.blk_alert import BLKAlert


def send_external_heart_beat():
    alarm = BLKAlert()
    alarm.send_external_alarm(
        ip="124.222.85.116",
        level="remind",
        alarm_name="心跳测试",
        alarm_content="心跳测试",
        action="firing",
    )

    alarm.send_external_alarm(
        ip="124.222.85.116",
        level="remind",
        alarm_name="心跳测试",
        alarm_content="心跳测试",
        action="resolved",
    )


def send_xiyuan_internal_heart_beat():
    alarm = BLKAlert()
    alarm.send_internal_alarm(
        ip="189.12.16.40",
        level="remind",
        alarm_name="西园内网zabbix心跳测试",
        alarm_content="内网zabbix心跳测试",
        action="firing",
    )
    time.sleep(1)
    alarm.send_internal_alarm(
        ip="189.12.16.40",
        level="remind",
        alarm_name="西园内网zabbix心跳测试",
        alarm_content="内网zabbix心跳测试",
        action="resolved",
    )


def _main():
    send_xiyuan_internal_heart_beat()


if __name__ == "__main__":
    _main()
